<?php
/*
 *author:Yangligao
 *Date:2013-9-28
 */

$advModel = new AdvModel();

//搜索的广告    1 没过期    2是最新的(按时间倒叙排列)  now()返回mysql中现在的日期时间   unix_timestamp:可以将时间转化为时间戳
$advModel = new AdvModel();

$resAdv = $advModel->adv_select("*","where adv_endtime > UNIX_TIMESTAMP(NOW())","limit 3","","group by adv_position");

for($i=0;$i<count($resAdv);$i++){
	$resAdv[$i]['adv_pic'] = basename($resAdv[$i]['adv_pic']);
}
$smarty->assign('advData',$resAdv);
?>
